package com.example.demo8.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RedisController {
    @Autowired
    private StringRedisTemplate redisTemplate;


    @RequestMapping("/set")
    public  String setRedit(){

        redisTemplate.opsForValue().set("username","zhansan");
        return "成功";

    }
}
